<html><head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>FormatXML</title></head>
<body bgcolor="#FFFFDF" link="#009999" vlink="#006666" alink="#006666">
<font face="Arial" size="2"><p align="center"><b><font size="4">FormatXML()</font></b></p>
<p><b>语法</b></p><blockquote>
<font color="#006666"><b>FormatXML</b></font>(#XML, Flags [, IndentStep])</blockquote>

</blockquote>
<b>概要</b><br><blockquote>



Cleans up or reformats the XML tree for a better look when <a href="exportxml.html">exporting</a>/<a href="savexml.html">saving</a>. 
It can be used to have a very compact output for efficient transfer or a more formatted 
output for better reading. 
<br>
<br>
The formatting of the parsed XML document is stored in the 'text' and 'offset' fields of 
each node in the tree (see <a href="getxmlnodetext.html">GetXMLNodeText()</a> and <a href="getxmlnodeoffset.html">GetXMLNodeOffset()</a> 
for more information). 

 

</blockquote><p><b>参数</b></p><blockquote>
<style type="text/css">
table.parameters { border-spacing: 0px; border-style: none; border-collapse: collapse; }
table.parameters td { border-width: 1px; padding: 6px; border-style: solid; border-color: gray; vertical-align: top; font-family:Arial; font-size:10pt; }
</style>
<table width="90%" class="parameters">
<tr><td width="10%"><i>#XML</i></td>
<td width="90%"> 
 
The XML to format. 

 

</td></tr>
<tr><td><i>Flags</i></td>
<td> 
 
It can be a combination of the following values (with the '|' operator): 
 
<pre><font face="Courier New, Courier, mono"size="2">  <font color="#924B72">#PB_XML_WindowsNewline</font>: Changes all newline to CRLF
  <font color="#924B72">#PB_XML_LinuxNewline</font>  : Changes all newline to LF
  <font color="#924B72">#PB_XML_MacNewline</font>    : Changes all newline to CR

  <font color="#924B72">#PB_XML_CutNewline</font>    : Removes all newline
  <font color="#924B72">#PB_XML_ReduceNewline</font> : Removes all empty lines

  <font color="#924B72">#PB_XML_CutSpace</font>      : Removes all spaces
  <font color="#924B72">#PB_XML_ReduceSpace</font>   : Removes all multiple spaces
 
  <font color="#924B72">#PB_XML_ReFormat</font>      : Completely reformats the tree structure
  <font color="#924B72">#PB_XML_ReIndent</font>      : Changes the indentation of the lines
</font></pre>

For <font color="#924B72">#PB_XML_ReFormat</font> and <font color="#924B72">#PB_XML_ReIndent</font> the 'IndentStep' parameter 
specifies how many spaces of indentation to add for each level. 
<br>
<br>
Note: There is no reformatting in CData sections and Processing Instructions except for the newline changes, 
as the whitespace contained inside these sections may be important depending on what is contained in the section. 
<br>
<br>
Note: Since MacOSX, the CR newline has become less common and the LF newline is used mostly like 
on other Unix systems. The <font color="#924B72">#PB_XML_MacNewline</font> is provided for completeness, but it is 
usually better to use <font color="#924B72">#PB_XML_LinuxNewline</font> even on MacOSX. 

 

</td></tr>
<tr><td><i>IndentStep (optional)</i></td>
<td> 
 
The indent to apply (in characters) when using the <font color="#924B72">#PB_XML_ReFormat</font> or <font color="#924B72">#PB_XML_ReIndent</font> flags 

 

</td></tr>
</table>
</blockquote><p><b>返回值</b></p><blockquote>
无.


</blockquote><p><b>参阅</b></p><blockquote>

<a href="exportxml.html">ExportXML()</a>, <a href="savexml.html">SaveXML()</a> 

</Blockquote><p><b>已支持操作系统 </b><Blockquote>所有</Blockquote></p><center>&lt;- <a href=extractxmlstructure.html>ExtractXMLStructure()</a> - <a href=index.html>XML Index</a> - <a href=freexml.html>FreeXML()</a> -&gt;



</body></html>